home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / netbon.zip / NETBIND.PAS < prev    next >
Pascal/Delphi Source File  |  1992-09-23  |  7KB  |  207 lines

  1. {
  2.   Turbo Pascal Unit of Bindery APIs for NetWare
  3.   version 1.1    9/5/91
  4.  
  5.   by Richard S. Sadowsky
  6.  
  7.   Please address questions and comments about this unit to ALL in section 6 of
  8.   the PCVENB forum on Compuserve.
  9.  
  10. }
  11.  
  12. {$A-,V-,F-}
  13.  
  14. Unit NetBind;
  15.  
  16. interface
  17.  
  18. {$IFDEF Windows}
  19.   {$DEFINE WindowsOrDPMI}
  20. {$ELSE}
  21.   {$IFDEF DPMI}
  22.     {$DEFINE WindowsOrDPMI}
  23.   {$ENDIF}
  24. {$ENDIF}
  25.  
  26. Uses
  27. {$IFDEF Windows}
  28.   WinProcs,
  29.   WinTypes,
  30.   WinDos,
  31.   WinDPMI,
  32.   NetWare;
  33. {$ELSE}
  34.   Dos,
  35.   {$IFDEF DPMI}
  36.   WinDPMI,
  37.   {$ENDIF}
  38.   NetWare;
  39. {$ENDIF}
  40.  
  41. const
  42.   {bindery object types}
  43.   bindUnknown          = $0000;
  44.   bindUser             = $0001;
  45.   bindGroup            = $0002;
  46.   bindPrintQueue       = $0003;
  47.   bindFileServer       = $0004;
  48.   bindJobServer        = $0005;
  49.   bindGateway          = $0006;
  50.   bindPrintServer      = $0007;
  51.   bindArchiveQueue     = $0008;
  52.   bindArchiveServer    = $0009;
  53.   bindJobQueue         = $000A;
  54.   bindAdministration   = $000B;
  55.   bindRemoteBridge     = $0026;
  56.   bindAdvertisingPrint = $0047;
  57.   bindWild             = $FFFF;
  58.  
  59.   {Object Security Flags}
  60.   bindAnyOne           = $00;
  61.   bindLogged           = $01;
  62.   bindObject           = $02;
  63.   bindSupervisor       = $03;
  64.   bindNetWare          = $04;
  65.  
  66.   {bindery Property Flags}
  67.   bindStatic           = $00;
  68.   bindDynamic          = $01;
  69.   bindItem             = $00;
  70.   bindSet              = $02;
  71.  
  72.   bindFirstProperty    = -1;
  73.  
  74.   bindSuccess          = $00;
  75.   bindServerOutOfMem   = $96;
  76.   bindMemberAlready    = $E9;
  77.   bindNotGroupProperty = $EB;
  78.   bindNoWildcard       = $F0;
  79.   bindNoPropWritePriv  = $F8;
  80.   bindNoSuchProperty   = $FB;
  81.   bindNoSuchObject     = $FC;
  82.   bindBinderyLocked    = $FE;
  83.   bindBinderyFailure   = $FF;
  84.  
  85. {$IFDEF Windows}
  86. type
  87.   Registers = TRegisters;
  88. {$ENDIF}
  89.  
  90. type
  91.   ObjNameStr           = String[47];        {string type for object names}
  92.   ObjNameField         = Array[0..47] of Char;
  93.   PropertyField        = Array[0..15] of Char;
  94.   PropertyStr          = String[15];        {string type for properties}
  95.   PasswordStr          = String[127];       {string type for passwords}
  96.   PropertyValueType    = record
  97.                            case Boolean of
  98.                              True  : (pvItem : Array[1..128] of Char);
  99.                              False : (pvSet  : Array[1..32] of LongInt);
  100.                          end;
  101. const
  102.   LogInControlSt       = 'LOGIN_CONTROL';
  103.   AccountServersSt     = 'ACCOUT_SERVERS';
  104.   AccountBalanceSt     = 'ACCOUNT_BALANCE';
  105.   PasswordSt           = 'PASSWORD';
  106.   SecurityEqualsSt     = 'SECURITY_EQUALS';
  107.   GroupMembersSt       = 'GROUP_MEMBERS';
  108.   GroupsImInSt         = 'GROUPS_I''M_IN';
  109.   NetAddressSt         = 'NET_ADDRESS';
  110.   IdentificationSt     = 'IDENTIFICATION';
  111.   OperatorsSt          = 'OPERATORS';
  112.  
  113.   {bindery function and subfunction numbers}
  114.   BinderyFunc          = $E3;
  115.   SubFAddObjToSet      = $41;
  116.   SubFChangeObjPass    = $40;
  117.   SubFChangeObjSec     = $38;
  118.   SubFChangePropSec    = $3B;
  119.   SubFCloseBindery     = $44;
  120.   SubFCreateObj        = $32;
  121.   SubFCreateProp       = $39;
  122.   SubFDeleteObj        = $33;
  123.   SubFDeleteObjFromSet = $42;
  124.   SubFDeleteProp       = $3A;
  125.   SubFGetAccessLevel   = $46;
  126.   SubFGetObjID         = $35;
  127.   SubFGetObjName       = $36;
  128.   SubFIsObjInSet       = $43;
  129.   SubFOpenBindery      = $45;
  130.   SubFReadPropVal      = $3D;
  131.   SubFRenameObj        = $34;
  132.   SubFScanObj          = $37;
  133.   SubFScanProp         = $3C;
  134.   SubFVerifyPass       = $3F;
  135.  
  136. function AddObjectToSet(ObjType : Word; ObjName : ObjNameStr;
  137.                         PropertyName : PropertyStr;
  138.                         MemberObjType : Word;
  139.                         MemberObjName : ObjNameStr) : Byte;
  140. function ChangePassword(ObjType : Word; ObjName : ObjNameStr;
  141.                         OldPassword, NewPassword : PasswordStr) : Byte;
  142. function ChangeObjectSecurity(ObjType : Word; ObjName : ObjNameStr;
  143.                               NewSecurity : Byte) : Byte;
  144. function ChangePropertySecurity(ObjType : Word; ObjName : ObjNameStr;
  145.                                 PropertyName : PropertyStr;
  146.                                 NewPropertySecurity : Byte) : Byte;
  147. function CloseBindery : Boolean;
  148. function CreateObject(ObjType : Word; ObjName : ObjNameStr;
  149.                       DynamicObj : Boolean;
  150.                       ObjSecurity : Byte) : Byte;
  151. function CreateProperty(ObjType : Word; ObjName : ObjNameStr;
  152.                         PropertyName : PropertyStr;
  153.                         DynamicProp, SetProp : Boolean;
  154.                         PropertySecurity : Byte) : Byte;
  155. function DeleteObject(ObjType : Word; ObjName : ObjNameStr) : Byte;
  156. function DeleteObjectFromSet(ObjType : Word; ObjName : ObjNameStr;
  157.                              PropertyName : PropertyStr;
  158.                              MemberObjType : Word;
  159.                              MemberName : ObjNameStr) : Byte;
  160. function DeleteProperty(ObjType : Word; ObjName : ObjNameStr;
  161.                         PropertyName : PropertyStr) : Byte;
  162. function GetBinderyAccessLevel(var AccessLevel : Byte;
  163.                                var ObjectID : LongInt) : Byte;
  164. function GetObjectID(var ObjType : Word; var ObjName : ObjNameStr;
  165.                      var ObjID : LongInt) : Byte;
  166. function GetObjectName(ObjectID : LongInt;
  167.                        var ObjType : Word;
  168.                        var ObjName : ObjNameStr) : Byte;
  169. function IsObjectInSet(ObjType : Word; ObjName : ObjNameStr;
  170.                        PropertyName  : PropertyStr;
  171.                        MemberObjType : Word;
  172.                        MemberName    : ObjNameStr) : Byte;
  173.   {-Returns 0 as function result if member is in set}
  174. function OpenBindery : Boolean;
  175. function ReadPropertyValue(ObjType : Word; ObjName : ObjNameStr;
  176.                            SegmentNumber : Byte;
  177.                            PropertyName  : PropertyStr;
  178.                            var PropertyValue : PropertyValueType;
  179.                            var PropertyFlags : Byte;
  180.                            var MoreSegments  : Boolean) : Byte;
  181. function RenameObject(ObjType : Word;
  182.                       OldObjName, NewObjName : ObjNameStr) : Byte;
  183. function ScanObject(var ObjType       : Word;
  184.                     var ObjName       : ObjNameStr;
  185.                     var ObjID         : LongInt;
  186.                     var ObjFlag       : Byte;
  187.                     var ObjSecurity   : Byte;
  188.                     var HasProperties : Boolean) : Byte;
  189. function ScanProperty(ObjType : Word; ObjName : ObjNameStr;
  190.                       var Sequence : LongInt;
  191.                       var PropertyName : PropertyStr;
  192.                       var PropertyFlags, PropertySecurity : Byte;
  193.                       var HasValue, MoreProperties : Boolean) : Byte;
  194. function VerifyPassword(ObjType : Word; ObjName : ObjNameStr;
  195.                         Password : PasswordStr) : Byte;
  196.  
  197. implementation
  198.  
  199. {$IFDEF WindowsOrDPMI}
  200.   {$I NETBINDW.INC}
  201. {$ELSE}
  202.   {$I NETBIND.INC}
  203. {$ENDIF}
  204.  
  205. end.
  206.  
  207.